import 'package:flutter/material.dart';

import 'dropdown_button_widget.dart';

class DropdownCardWidget extends StatelessWidget {
  final String hintText;
  final String title;
  final List<String> data;
  final EdgeInsets margin;
  final String selectValue;

  Border border;

  DropdownCardWidget(
      {this.hintText,
      @required this.title,
      @required this.data,
      this.margin,
      this.border,this.selectValue});

  @override
  Widget build(BuildContext context) {
    if (border == null) {
      border = Border(bottom: BorderSide(width: 1, color: Color(0xffefefef)));
    }
    // TODO: implement build
    return Container(
        width: double.infinity,
        margin: margin,
        padding: EdgeInsets.only(left: 16, right: 16),
        decoration: BoxDecoration(color: Colors.white, border: border),
        child: new Row(
          children: <Widget>[
            Container(
              child: Text(title, style: TextStyle(fontSize: 16)),
              padding: EdgeInsets.only(top: 15, bottom: 15, right: 8),
            ),
            Expanded(
              child: DropdownButtonStatefulWidget(
                list: data,
                hintText: hintText,
                selectValue: selectValue,
              ),
            )
          ],
        ));
  }
}
